<?php
class User extends AppModel {

	var $name = 'User';
	var $useTable = 'users';

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $hasMany = array(
			'Purchase' => array('className' => 'Purchase',
								'foreignKey' => 'user_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => '',
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			)
	);

	var $validate = array(
		'username' => array(
			'rule1' => array(
				'rule' => 'isUnique',
				'message' => 'Sorry, that username is taken!'
			),
			'rule2' => array(
				'rule' => 'alphaNumeric',
				'message' => 'Usernames can only contain letters and numbers'
			)
		),
		'email' => array(
			'rule' => 'email',
			'message' => 'You need to enter a valid email address!'
		)
	);

}
?>